﻿<ribbon:RibbonWindow x:Class="AccountPolicies"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        Title="AccountPolicies"
        x:Name="AccountPolicies"
        Width="Auto" Height="Auto" Icon="../../images/Main/keys.png" SizeToContent="WidthAndHeight">

    <ribbon:RibbonWindow.Resources>
        <!--<Style TargetType="{x:Type TextBox}">
            <Setter Property='Margin' Value='0,0,0,0' />
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <DockPanel LastChildFill="True">
                            <TextBlock 
                                DockPanel.Dock="Right"
                                Foreground="Orange"
                                FontFamily='WingDings'
                                FontSize="14"
                                FontWeight="Bold"
                                ToolTip='{Binding ElementName=customAdorner,
                                Path=AdornedElement.(Validation.Errors)[0].ErrorContent}'>&#163;
                            </TextBlock>
                            <AdornedElementPlaceholder Name="customAdorner" />
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>-->
    </ribbon:RibbonWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <ribbon:Ribbon x:Name="Ribbon">
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu Visibility="Collapsed" >
                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>
            <ribbon:Ribbon.QuickAccessToolBar>
                <ribbon:RibbonQuickAccessToolBar Visibility="Collapsed"></ribbon:RibbonQuickAccessToolBar>
            </ribbon:Ribbon.QuickAccessToolBar>

            <ribbon:RibbonTab x:Name="AccountPoliciesTab"
							  
							  Header="Account Policies">
                <ribbon:RibbonGroup x:Name="Actions"
									Header="Actions">
                    <ribbon:RibbonButton x:Name="buttonRefresh"
										 LargeImageSource="../../images/actions/Refresh-64.png"
										 Label="Refresh" />
                    <ribbon:RibbonButton x:Name="buttonSave"
										 LargeImageSource="../../images/actions/ctrlsave.png"
										 Label="Save"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>
        <Grid Grid.Row="1">
            <Border Name="borderHeader1" 
                Grid.Column="1" 
                BorderBrush="Gray" 
                BorderThickness="1,1,1,1" 
                CornerRadius="6,6,6,6">
                


                <GroupBox Header="Password">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"></RowDefinition>
                            <RowDefinition Height="auto"></RowDefinition>
                            <RowDefinition Height="auto"></RowDefinition>
                            <RowDefinition Height="auto"></RowDefinition>
                        </Grid.RowDefinitions>
                        <GroupBox Header="Length" Margin="5,10,5,10"  Grid.Row="0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>


                                <Label Grid.Column="0" Height="auto" Name="Label1" Width="auto" VerticalAlignment="Center" >Minimum password length</Label>

                                <TextBox Grid.Column="1" 
                                         Name="textboxPasswordLength" 
                                         Width="30"
                                         Text="{Binding Path=PWLength
                                    ,UpdateSourceTrigger=PropertyChanged
                                    ,ValidatesOnExceptions=True
                                    ,TargetNullValue=''
                                    ,NotifyOnValidationError=true}" 
                                         Validation.Error="TextBox_Error"  />
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Expiration" Margin="5,10,5,10"  Grid.Row="1">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Label Grid.Row="1" Grid.Column="0" Height="auto" Name="Label3" Width="auto" VerticalAlignment="Center" >Password expires every</Label>
                                <TextBox Grid.Row="1" 
                                         Grid.Column="1" 
                                         Height="auto" 
                                         Width="30" 
                                         Name="textboxExpirationDays" 
                                         Text="{Binding Path=PWExpiration
                                    ,UpdateSourceTrigger=PropertyChanged
                                    ,ValidatesOnExceptions=True
                                    ,TargetNullValue=''
                                    ,NotifyOnValidationError=true}" 
                                         Validation.Error="TextBox_Error"></TextBox>
                                <Label Grid.Row="1" Grid.Column="2" Height="auto" Name="Label4" Width="auto" VerticalAlignment="Center" >days (0 to never expire)</Label>
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Format" Margin="5,10,5,10"  Grid.Row="2">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                </Grid.RowDefinitions>
                                <CheckBox Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Name="cbPasswordFormatAlphaNumeric" Margin="1,2,1,2" IsChecked="{Binding Path=PWFormat1, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                                <CheckBox Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Name="cbPasswordFormatSpecialChar" Margin="1,2,1,2" IsChecked="{Binding Path=PWFormat2, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                                <CheckBox Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Name="cbPasswordFormatUpperCase" Margin="1,2,1,2" IsChecked="{Binding Path=PWFormat3, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                                <CheckBox Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Name="cbPasswordFormatDifferentFromId" Margin="1,2,1,2" IsChecked="{Binding Path=PWDifferentFromID, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                                <Label Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" >Require alpha numeric password</Label>
                                <Label Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" >Require at least one special character</Label>
                                <Label Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" >Require upper and lower case combination</Label>
                                <Label Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" >Password different from ID</Label>
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Lock Account" Margin="5,10,5,10"  Grid.Row="3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" >Lock account after</Label>
                                <Label Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" >unsuccessful attempts (0 for no locks)</Label>
                                <TextBox Grid.Row="1" 
                                         Grid.Column="1" 
                                         Height="auto" 
                                         Width="30" 
                                         Name="textboxLockAccount" 
                                         Text="{Binding Path=PWLockAccount
                                    ,UpdateSourceTrigger=PropertyChanged
                                    ,ValidatesOnExceptions=True
                                    ,TargetNullValue=''
                                    ,NotifyOnValidationError=true}" 
                                         Validation.Error="TextBox_Error"></TextBox>


                            </Grid>
                        </GroupBox>
                    </Grid>
                </GroupBox>
            </Border>
        </Grid>
    </Grid>
</ribbon:RibbonWindow>
